package com.storydo.spring.shell.command;


import org.jline.utils.AttributedString;
import org.jline.utils.AttributedStyle;
import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;
import org.springframework.shell.standard.ShellOption;

/**   
* @Title: Command.java 
* @Description: TODO
* @author : Storydo
* @date: 2021年8月26日 下午3:58:11 
* @version:V1.0 
* Copyright 悦享互联 2016 All right reserved.
* Modification  History:
* Version       Date          Author          Description
* ----------------------------------------------------------------------------
*  1.0         2021年8月26日        Storydo              TODO
*/
@ShellComponent
public class Command {

	@ShellMethod("Add two integers together.")
    public int add(int a, int b) {
        return a + b;
    }
	
	@ShellMethod("Say Hello World")
    public AttributedString hello(@ShellOption(defaultValue="World!") String world) {
		
        return new AttributedString("Hello " + world, AttributedStyle.DEFAULT.foreground(AttributedStyle.RED));
    }
}
